home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48hor1 / cfd.doc < prev    next >
Text File  |  1995-03-31  |  3KB  |  57 lines

  1. (Comp.sys.handhelds) 
  2. Item: 2264 by fseipel at hpuxa.ircc.ohio-state.edu 
  3. Author: [Frank Seipel] 
  4.   Subj: HP-48SX; subroutine (subscripted chemical formulae) 
  5.   Date: Thu Feb 28 1991 
  6.  
  7. Chemical Formula Display Utility (CFD) 
  8. by Frank Seipel 
  9.  
  10.  The following is a short RPL subroutine, to be called CFD, and a short 
  11. example program, Call, which demonstrates its use. The purpose of CFD is to 
  12. provide a means of displaying subscripted chemical formulae in user programs. 
  13.  
  14. CFD takes three arguments, an x-coordinate (binary integer), a y-coordinate 
  15. (binary integer), and a text string (formula to display). The formula will be 
  16. superimposed on PICT, beginning at the location specified by your coordinates. 
  17. Any numerals in the formula will be subscripted, so as to appear like a 
  18. chemical formula you would write on paper. Optionally you may include an '@' 
  19. character in the string. This is interpreted as: go to column #50d and add the 
  20. rest of the string to PICT at once, without subscripts -- this may be useful 
  21. in right-justifying the names of compounds next to their names (see example 
  22. program).  See page 324 of the manual for a diagram showing the binary 
  23. coordinate system; the upper left corner is { #0d #0d }, the bottom right 
  24. corner is { #130 #63 }. To type '@' on the HP-48SX, key in: alpha, followed by 
  25. blue shift, and then ENTER. 
  26.  
  27. I realize this program is rather straightforward, but it seems as if it would 
  28. be something which will be written over and over by many people so I decided 
  29. to post it to the net. I am working on a program to let you scroll through 
  30. subscripted formulas of common compounds. Once I have this working I will 
  31. write a program to compute specific enthalpy at a given temperature, and to 
  32. display other physical properties such as boiling points, heats of formation, 
  33. vaporization, and combustion. 
  34.  
  35.  If you didn't guess, YES, I am studying Chemical Engineering... 
  36.  
  37. ---------------- STO this program as 'Call' ------------------------ 
  38.  
  39. %%HP: T(3)A(R)F(.); 
  40. \<< # 0d # 22d "H2SO4@Sulfuric Acid" CFD { } PVIEW 
  41. \>> 
  42.  
  43. ---------------- Second example ------------------------------------ 
  44.  
  45. Example calling sequence: 
  46.  
  47. 4:                      #0d 
  48. 3:                      #0d 
  49. 2:   "CH3CH2CH3@Propane" 
  50. 1:                      CFD 
  51.  
  52. Then hit orange-shift-graph to display PICT to see the subscripted formula in 
  53. the upper right hand corner of screen. See also 'Call', above. 
  54.  
  55. Note: You may wish to adjust how far '@' goes over horizontally, depending 
  56. on the length of your formula. 
  57.